local jLootz = jLootz
local lib = jLootz:NewModule("Group")

function lib:OnInitialize()
	self.db = jLootz.db:RegisterNamespace("Group")
	self.frames = {count = 0}
	self.OnInitialize = nil
end

function lib:START_LOOT_ROLL(id, timeleft)
	local f = self:GetRollFrame()
	self:FillRollFrame(f, id, timeleft)
end

function lib:CANCEL_LOOT_ROLL(id)
	self:HideConfirm()

	local frames = self.frames
	for i = 1, frames.count do
		local frame = frames[i]
		if frame.id == id then
			frame:Hide()
			return
		end
	end
end

function lib:CONFIRM_LOOT_ROLL(id, rolltype)
	local frames = self.frames
	for i = 1, frames.count do
		local frame = frames[i]
		if frame.id == id then
			self:ShowConfirm(frame, id, rolltype)
			return
		end
	end
end
